<%= error_messages_for(@customization) %>
<%= javascript_include_tag'jquery', 'application'%>
<h1>Best Fit Form</h1>
<br />
<br>
<% if (@customizations) %>
    <% if (@customizations.empty?)%>
        <% if (params[:customization]['name'].empty? || params[:customization]['model'].empty?)%>
            <%= javascript_tag("empty_best_fit_form_error();")%>  
        <%else%>
            <%= javascript_tag("best_fit_fail();")%>
        <%end%>
    <% else %>
        <%= javascript_tag("best_fit_success();")%>
        <center>
            <%= image_tag("#{@customizations[0].image}", :height => "600px" ,:width => "300px", :size => "20%", :align => 'right')%>  
             <br />
             <br />
             <br />
             <%= link_to("NEXT", {:controller => "customizations", 
                                    :action => "edit", :id => @customizations[0].id}, :class => "next-link")%>
        </center>
    <%end%>
<%end %>

<br />
<div class= "best-fit">
    <%= form_for(:customization, :url => {:action => "best_fit_create", :template => "best_fit"}, 
                                                        :html => {:multipart => true}) do |f| %>
                <b>Server Name:</b>
                <%= f.text_field(:name)%>
                <br />
                <br />
                <b>Server Model: </b>
                <%= f.text_field(:model) %>
                <br />
                <br />
                <br />
                <div class= "form-buttons">
                   <b><%= f.submit("Start Search") %><b>
                </div>
    
    <% end %>
</div>
<br />
<%= render(:partial => "shared/upload")%>
<br />
<%= link_to("Back to Storage", {:controller => "customizations", 
                                    :action => "index"}, :class => "back-link")%>
                                    
<br />
<br />
<br />
<%= debug(@customizations) %>
<br />
<%= debug(@customization) %>
<br />
<br />
<%= params.inspect %>